function useNavigate() {
  /**
   * 跳转至横屏页面并传递数据
   * @param options
   * @param options.chartType 图表类型: revenue(收益趋势图), store(门店收益图), order(订单维度下费用及订单数统计), cost(费用生成时间或结算时间统计订单费用)
   * @param options.barTitle 图表标题: 可以自定义
   * @param options.echartData 图表数据
   */
  const navigateTo = (options: { chartType: string; barTitle: string; echartData: any }) => {
    uni.navigateTo({
      url: '/pages/revenue-summary/components/echarts/components/LandscapeChart',
      success: (res) => {
        res.eventChannel.emit('LandscapeData', {
          chartType: options.chartType,
          barTitle: options.barTitle,
          echartData: options.echartData,
        })
      },
    })
  }

  return {
    navigateTo,
  }
}

export default useNavigate
